package cn.com.infohold.smartcity.activity.Publishinfo;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.TextView;

import cn.com.infohold.smartcity.R;
import cn.com.infohold.smartcity.api.bean.NewsBean;
import cn.com.infohold.smartcity.parent.ParentActivity;
import common.annotation.ViewInject;

/**
 * Created by Monsoon on 2017/11/8.
 */
public class PublishInfoDetail_Activity extends ParentActivity{

    @ViewInject(R.id.ib_back)
    ImageButton ib_back;
    @ViewInject(R.id.tv_newstitle)
    TextView tv_newstitle;
    @ViewInject(R.id.tv_content)
    TextView tv_content;

    private NewsBean newsBean;

    @Override
    protected Object inflateView() {
        return R.layout.activity_publish_detail;
    }

    @Override
    protected void initView(View anchor) {

        Intent intent = getIntent();
        Bundle publish_detail = intent.getBundleExtra("publish_bundle");
        if (publish_detail != null){
            newsBean = (NewsBean) publish_detail.getSerializable("publish_detail");
            tv_newstitle.setText(newsBean.getTitle());
            tv_content.setText(newsBean.getContent());

        }

        ib_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
                overridePendingTransitionFade();
            }
        });
    }
}
